![]() |
PostEvent |
||||
Header: | Events.h | Carbon status: | Supported | |
Posts events into the Operating System event queue.
OSErr PostEvent ( EventKind eventNum, UInt32 eventMsg );
A value that indicates the type of event to post into the Operating System event queue. You specify the event kind using one or more of these values defined by
An unsigned integer that contains the contents of the message field for the event that PostEvent should post in the queue.
A result code.
In the eventNum and eventMsg parameters, you specify the value for the what and message fields of the event’s event structure. The PostEvent function fills out the when, where, and modifiers fields of the event structure with the current time, current mouse location, and current state of the modifier keys and mouse button.
The PostEvent function posts only events that are enabled by the system event mask. If the event queue is full, PostEvent removes the oldest event in the queue and posts the new event.
Note that if you use PostEvent to repost an event, the PostEvent function fills out the when, where, and modifier fields of the event structure, giving these fields of the reposted event different values from the values contained in the original event.
Do not post any events other than mouse-down, mouse-up, key-down, key-up, auto-key, and disk-inserted events in the Operating System event queue. Attempting to post other events into the Operating System event queue interferes with the internal operation of the Event Manager.
In most cases, your application should not call the PostEvent function.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)